sync docs#67 spec fixes + restore toon tag (toon keys regressed to PascalCase in #3)#4
Merged
Merged
Conversation
Picks up the 4 spec fixes merged in flashcatcloud/flashduty-docs#67, surfaced by the fduty CLI full-coverage agent eval: - AuditRecordIDRequest split off RuleIDRequest for /monit/rule/audit/detail — ReadAuditDetail now takes *AuditRecordIDRequest; its id is the audit-record id from /monit/rule/audits rows, not the rule id. - IncidentShort/IncidentRawItem.progress enum corrected (Triggered/Processing/Closed). - InsightFilter.export_fields 29-value column-key enum. - /incident/post-mortem/info description clarified (fetch by post_mortem_id). Pure sync + `go generate ./...` against the current generator; build green. No release (untagged).
#3 dropped the `toon:"..."` tag from generated structs, emitting only `json:"..."`. But toon-go (internal/codec/structmeta.go) reads ONLY the `toon` tag and falls back to the Go field NAME when it is absent — it does NOT read `json`. So `--output-format toon` started rendering PascalCase keys (AccountID, CreatedAt) instead of snake_case (account_id, created_at), while `--json` and the spec-derived help stayed snake_case. An agent that reads a field name off a toon dump and pipes it into `--json | jq '.account_id'` hits all-null. Restore the `toon` tag mirrored from `json` (snake_case), and re-add the comment explaining why so it is not dropped again. Verified: toon keys are snake_case again across generated list output.
ysyneu
added a commit
that referenced
this pull request
Jun 2, 2026
The compiled `gen` executable (go build ./internal/cmd/gen at repo root) was accidentally swept into #4 by git add -A. Remove the 4.3MB binary and ignore the root-level /gen path (anchored so it doesn't match internal/cmd/gen/).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two commits. Surfaced by the
fdutyCLI full-coverage agent eval while landing the spec fixes downstream.Commit 1 — sync OpenAPI from flashduty-docs
main(incl. docs#67) + regenerateAuditRecordIDRequestsplit offRuleIDRequestfor/monit/rule/audit/detailReadAuditDetailnow takes*AuditRecordIDRequest(id = audit-record id, not rule id)IncidentShort/IncidentRawItem.progressTriggered/Processing/ClosedInsightFilter.export_fields/incident/post-mortem/infoCommit 2 — fix(gen): restore the⚠️ regression from #3
toonstruct tag#3 dropped the
toon:"..."tag from generated structs (emitting onlyjson:"..."). Buttoon-go(internal/codec/structmeta.go) reads only thetoontag and falls back to the Go field name when absent — it does not readjson. So since #3,--output-format toonrenders PascalCase keys (AccountID,CreatedAt) instead of snake_case (account_id,created_at), while--jsonstays snake_case.This breaks every
toonconsumer (CLI, MCP) and the agent pattern "read field name from a toon dump →--json | jq '.account_id'" → all-null. Evidence (sameincident list --output-format toon):account_id: 2451002751131AccountID: 2451002751131Restored the tag + re-added the explaining comment so it is not dropped again. @author of #3 — flag me if you intended a different fix (e.g. teaching toon-go to read
json); this is the minimal proven restore.No release (untagged).
go generate ./...+go build/go vetgreen.Deferred (separate PRs)
,omitemptyon response structs so false/0/[]/{} survive--json) — layers on the sameemitStructline; patch saved.alertRuleAuditDetails' input off the sharedtypes.IDInputso a future api-review regen keepsAuditRecordIDRequest(needs schema-naming verification).